<?php
/**
 * Created by Shijie Liu. 2017/6/21
 *  首页畅销和好评图书,奇数和偶数生成
 */

    include 'config/mysqlconfig.php';
    include 'class/Book.php';

//   echo getIndexBooks($con,1);


    function getIndexBooks($con,$type){

        if ($type == 1){
            $i = 1;
        }else{
            $i = 2;
        }
        $b = new Book($con);
        for ($i; $i < 15; $i= $i+2) {

            $book_id = $i + 1000;
            $book_i[$i] = $b->getBookInfo($book_id);//获得图书信息
        }
        return $book_i;
    }
//    $con->close();
//unset($con);
